A group G is called logically generated by a subset S, if every element of G can be defined by a first order formula with parameters from S. We consider the case where G is a direct product of finite nilpotent groups with mutually coprime orders and we show that logical and algebraic generations are equivalent in G. We also prove that in the case when G is a free non-abelian group, if S logically generates G then either it generates G algebraically or 〈 S 〉 is not a free factor of G.